package org.xiji.Prototype;

/**
 * 原型模式测试类
 */
public class PrototypeMain {

    public static void main(String[] args) throws CloneNotSupportedException {
        Student student = new Student("xiji", 18);
        Student clone = student.clone();

        String name = clone.getName();
        System.out.println("name = " + name);
        System.out.println(student.equals(clone));

        Student cloneByStream = student.cloneByStream();
        System.out.println("cloneByStream = " + cloneByStream.getName());

        System.out.println(student.equals(cloneByStream));


    }
}
